<template>
	<view class="continer">
		<navBar name="请选择公司"></navBar>
		<nut-cell v-for="item in agentList" :key="item.agentId" :title="item.agentName" isLink
			@tap="checkAgent(item)"></nut-cell>
	</view>
</template>

<script setup>
	import {
		ref,
	} from "vue";
	import useUserState from '@/stores/user.js'
	const {
		setAgentId
	} = useUserState()

	const agentList = ref(uni.getStorageSync('agentList'))

	const checkAgent = async ({
		agentId
	}) => {
		await setAgentId(agentId);
		uni.redirectTo({
			url: '/pages/vehicleWarning/vehicleWarning'
		});
	}
</script>

<style scoped lang="scss">
	.continer {
		height: 100vh;
		overflow: hidden;
		--nut-cell-color: #666;
		--nut-cell-desc-color: #333;
	}
</style>